/// @file test_modular_components/main.cpp
/// @brief Test for individual modular components
/// 
/// This file tests the individual modular components (UiAo, AuthAo, DbAo)
/// without running the full QP framework.

#include "ui_ao.h"
#include "auth_ao.h"
#include "db_ao.h"
#include "auth_events.h"
#include "unity.h"
#include "spdlog/spdlog.h"

// Test that all AO instances can be created
void test_ao_creation(void) {
    TEST_ASSERT_NOT_NULL(the_AO_Ui);
    TEST_ASSERT_NOT_NULL(the_AO_Auth);
    TEST_ASSERT_NOT_NULL(the_AO_Db);
}

// Test that AuthAo has initial state
void test_auth_ao_initial_state(void) {
    TEST_ASSERT_FALSE(the_AO_Auth->isAuthenticated());
    TEST_ASSERT_EQUAL_INT(-1, the_AO_Auth->getCurrentUserId());
    TEST_ASSERT_TRUE(the_AO_Auth->getCurrentSessionToken().empty());
}

int main(void) {
    spdlog::info("Starting Modular Components Test");
    
    UNITY_BEGIN();
    RUN_TEST(test_ao_creation);
    RUN_TEST(test_auth_ao_initial_state);
    int result = UNITY_END();
    
    spdlog::info("Modular Components Test completed with result: {}", result);
    return result;
}